package com.two.service.user.controller.api;

import com.google.gson.Gson;
import com.two.common.entity.User;
import com.two.common.entity.UserAndPermissions;
import com.two.common.util.CommonResult;
import com.two.service.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("api/user/user")
public class ApiUserController {

    @Autowired
    private IUserService iUserService;
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    //修改角色的rid和roleid
    @PostMapping("updateRidAndRoleid")
    public Integer updateRidAndRoleid(@RequestParam Integer rid, @RequestParam Integer userid){
        User user1=new User();
        user1.setUserid(userid);
        user1.setRoleid(2);
        user1.setRid(rid);
       return iUserService.xiu(user1);


    }
}
